Gene set enrichment analysis

Given a set of genes, how can we compute the ‘surprise’ in enriched functional or other annotation using Gene Ontology terms associated with genes?